import React, { Component } from 'react';
import { BackHandler } from 'react-native';
class BaseComponent extends Component {
    constructor(props) {
        super(props);
        BackHandler.addEventListener('hardwareBackPress',  ()=> {
            const { navigator } = this.props;
            if(navigator) {
                navigator.pop();
                return true;
            }
            return false;

        });
    }
}
module.exports = BaseComponent;   // 这里需用这种方法，否则会报 super 的错